package com.zeus.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @author 冯扬龙
 * @date 2021/4/22 20:11
 */
@Controller
public class IndexController {

//    点击登录按钮进入首页
    @RequestMapping("/index")
    public String go_index(HttpServletRequest request){
        HttpSession session = request.getSession();
        if(session.getAttribute("admins") != null){
           return "index";
        }else {
            return "error";
        }
    }
}
